{{template "goods_layout.html" . }}
{{define "layoutcontent"}}
	<div class="main_wrap clearfix">
		<div class="l_wrap fl clearfix">
		</div>

		<div class="r_wrap fr clearfix">
			<div class="sort_bar">
				<a href="/goodsSearch?keywords={{.keywords}}&sortId=0" class="active">默认</a>
				<a href="/goodsSearch?keywords={{.keywords}}&sortId=1">价格</a>
				<a href="/goodsSearch?keywords={{.keywords}}&sortId=2">人气</a>
			</div>

			<ul class="goods_type_list clearfix">
				{{ range .goods}}
					<li>
						<a href="/goodsDetail?id={{.Id}}"><img src="http://94.191.18.219:8888/{{.Image}}"></a>
						<h4><a href="/goodsDetail?id={{.Id}}">{{.Name}}</a></h4>
						<div class="operate">
							<span class="prize">￥{{.Price}}</span>
							<span class="unit">￥{{.Price}}/{{.Unite}}</span>
							<a href="#" class="add_goods" title="加入购物车"></a>
						</div>
					</li>
				{{end}}
			</ul>

			<div class="pagenation">
				<a href="/goodsSearch?keywords={{.keywords}}&sortId={{.sortId}}&pageIndex={{.prePage}}"><上一页</a>
				{{range $index,$val:= .pages}}
					{{if compare $val $.pageIndex}}
						<a href="/goodsSearch?keywords={{$.keywords}}&sortId={{$.sortId}}&pageIndex={{$val}}" class="active">{{$val}}</a>
					{{else}}
						<a href="/goodsSearch?keywords={{$.keywords}}&sortId={{$.sortId}}&pageIndex={{$val}}">{{$val}}</a>
					{{end}}
				{{end}}
					<a href="/goodsSearch?keywords={{.keywords}}&sortId={{.sortId}}&pageIndex={{.nextPage}}">下一页></a>
			</div>
		</div>
	</div>
	{{end}}